package com.ztjava.common.listener.push;

import com.jfinal.aop.Duang;
import com.jfinal.kit.Ret;
import com.ztjava.common.service.PushService;
import com.ztjava.core.bean.sub.CaptchaBean;
import com.ztjava.plugin.event.EventTag;
import com.ztjava.plugin.event.core.ApplicationListener;
import com.ztjava.plugin.event.core.Listener;
import com.ztjava.plugin.event.core.RequestEvent;

@Listener(tag = EventTag.COMMON_PUSH_CHECKCAPTCHA)
public class PushCaptchaListener implements ApplicationListener<RequestEvent>{

	private static PushService pushService = Duang.duang(PushService.class);
	@Override
	public Ret onApplicationEvent(RequestEvent event) {
		CaptchaBean captchaBean = (CaptchaBean)event.getSource();
		Ret ret = pushService.checkMessageCaptcha(captchaBean);
		return ret;
	}

}
